﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLCMS.Data.Model;
using NHibernate;
using DotNet.Common.NHibernateUtil;
using NHibernate.Criterion;
using ZLCMS.Business.Util;

namespace ZLCMS.Web.SystemManage.weixin.MessageRecord
{
    public partial class MessageRecordDetail : System.Web.UI.Page
    {
        public WxMessageRecord MsgRecord { get; set; }

        protected string _userAccount;

        protected void Page_Load(object sender, EventArgs e)
        {
            _userAccount = UserKit.GetUserAccountFailLogin();

            using(ISession session = DotNet.Common.NHibernateUtil.SessionFactoryHelper.CreateSession())
            {
                MsgRecord = session.CreateCriteria<WxMessageRecord>().Add(Expression.Eq("Id", Int32.Parse(Request["uid"]))).Add(Expression.Eq("OwnerAccount", _userAccount)).UniqueResult<WxMessageRecord>(); ;
            }
        }
    }
}